package com.xuecheng.content.feignclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2024-07-14
 * Time: 18:09
 */

@Component
@Slf4j
public class MediaServiceClientFallbackFactory implements FallbackFactory<MediaServiceClient> {
    @Override
    public MediaServiceClient create(Throwable throwable) {
        return (filedata, objectName) -> {
            log.debug("远程调用媒资管理服务上传文件时发生熔断错误，错误信息:{}", throwable.getMessage());
            return null;
        };
    }
}
